for _ in range(int(input())):
a = int(input())
print('NO' if 360%(180 - a) > 0 else 'YES')
#include<bits\stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define UG ios_base::sync_with_stdio(0); cin.tie(0)
bool isInt(float x){
int x2 = x;
if (abs(x - x2)) return false;
else return true;
}
int main() {
UG;
int n; cin >> n;
while (n--)
{
float x; cin >> x;
float ans = 2.0 / (1.0 - (x/180.0));
if (isInt(ans)) cout << "YES" << endl;
else cout << "NO" << endl;
}
}
/*
7
..RRR..
*/
1480B - The Great Hero | 1519B - The Cake Is a Lie |
1659C - Line Empire | 515A - Drazil and Date |
1084B - Kvass and the Fair Nut | 1101A - Minimum Integer |
985D - Sand Fortress | 1279A - New Year Garland |
1279B - Verse For Santa | 202A - LLPS |
978A - Remove Duplicates | 1304A - Two Rabbits |
225A - Dice Tower | 1660D - Maximum Product Strikes Back |
1513A - Array and Peaks | 1251B - Binary Palindromes |
768B - Code For 1 | 363B - Fence |
991B - Getting an A | 246A - Buggy Sorting |
884A - Book Reading | 1180A - Alex and a Rhombus |
445A - DZY Loves Chessboard | 1372A - Omkar and Completion |
159D - Palindrome pairs | 981B - Businessmen Problems |
1668A - Direction Change | 1667B - Optimal Partition |
1668B - Social Distance | 88B - Keyboard |